#define _GNU_SOURCE
#include "app_pool.h"
#include "log/log.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int Test_func(void *arg)
{
    char *data = (char*)arg;
    log_debug("task_fun arg=%s, tid=%d", data, gettid());
    free(data);
}

int main(int argc, char const *argv[])
{
    App_Pool_Init(5);
    for (int i = 0; i < 10; i++)
    {
        char *p = malloc(10);
        sprintf(p, "hello_%d", i);
        App_Pool_RegisterTask(Test_func, p);
    }
    sleep(1);
    App_Pool_close();
    return 0;
}
